home *** CD-ROM | disk | FTP | other *** search
/ Computer Inter@ctive 17 / Computer Interactive cdrom 17 - gen 99.iso / ZDNETIT / CONTENT / OPTIVDOS.ZIP / INCLUDE.ZIP / MGRAPH.H < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-21  |  7.4 KB  |  161 lines

  1. /*  Mgraph.h
  2.  
  3.   matrix graphics functions for all floating-point data types
  4.   for image processing
  5.  
  6.   Copyright (c) 1996-1998 by Martin Sander
  7.   All Rights Reserved.
  8. */
  9.  
  10. #ifndef __MGRAPH_H
  11. #define __MGRAPH_H
  12. #if !defined( __VGRAPH_H )
  13.    #include <VGraph.h>
  14. #endif
  15. #if !defined( __MATLIB_H )
  16.     #include <MatLib.h>
  17. #endif
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21.  
  22. /*  Density map:  values are translated into a color between
  23.     two extremes, given as mincolor and maxcolor.
  24. */
  25.  
  26. typedef struct {
  27.       VCOORDSYSTEM CartesCoord;
  28.       extended     z_max, z_min, z_range, z_maxoverrange,
  29.                    x_LoBorder, x_HiBorder, x_Pad,
  30.                    y_LoBorder, y_HiBorder, y_Pad,
  31.       #if defined _WINDOWS
  32.            z_densityScale[4];
  33.       #else
  34.            z_densityScale;
  35.       #endif
  36.       COLORREF z_minColor;
  37. } MCOORDSYSTEM;
  38.  
  39. #define M_continuePlot V_continuePlot
  40. void __vf M_getCoordSystem( MCOORDSYSTEM _VFAR *xcs );
  41. void __vf M_setCoordSystem( MCOORDSYSTEM _VFAR *xcs );
  42.  
  43. void __vf M_findDensityMapBounds( extended xmin, extended xmax,
  44.                                   extended ymin, extended ymax,
  45.                                   extended zmin, extended zmax,
  46.                                   COLORREF mincolor, COLORREF maxcolor );
  47. void __vf M_setDensityMapBounds(  extended xmin, extended xmax,
  48.                                   extended ymin, extended ymax,
  49.                                   extended zmin, extended zmax,
  50.                                   COLORREF mincolor, COLORREF maxcolor );
  51. void __vf M_setDensityBounds(  extended zmin, extended zmax,
  52.                                COLORREF mincolor, COLORREF maxcolor );
  53.  
  54. #define MF_xyzAutoDensityMap( X, Y, MZ, ht, len, mincol, maxcol ) \
  55.                  MFxyzAutoDensityMap( X, Y, MZ[0], ht, len, mincol, maxcol )
  56. #define MF_xyzDataDensityMap( X, Y, MZ, ht, len ) \
  57.                  MFxyzDataDensityMap( X, Y, MZ[0], ht, len )
  58. #define MF_zAutoDensityMap( MZ, ht, len, mincol, maxcol ) \
  59.                  MFzAutoDensityMap( MZ[0], ht, len, mincol, maxcol )
  60. #define MF_zDataDensityMap( MZ, ht, len ) \
  61.                  MFzDataDensityMap( MZ[0], ht, len )
  62.  
  63. void __vf MFxyzAutoDensityMap( fVector X, fVector Y, fPMatrix MZ,
  64.                              unsigned ht, unsigned len,
  65.                              COLORREF mincolor, COLORREF maxcolor );
  66. void __vf MFxyzDataDensityMap( fVector X, fVector Y, fPMatrix MZ,
  67.                              unsigned ht, unsigned len );
  68. void __vf MFzAutoDensityMap( fPMatrix MZ, unsigned ht, unsigned len,
  69.                              COLORREF mincolor, COLORREF maxcolor );
  70. void __vf MFzDataDensityMap( fPMatrix MZ, unsigned ht, unsigned len );
  71.  
  72. #define MD_xyzAutoDensityMap( X, Y, MZ, ht, len, mincol, maxcol ) \
  73.                  MDxyzAutoDensityMap( X, Y, MZ[0], ht, len, mincol, maxcol )
  74. #define MD_xyzDataDensityMap( X, Y, MZ, ht, len ) \
  75.                  MDxyzDataDensityMap( X, Y, MZ[0], ht, len )
  76. #define MD_zAutoDensityMap( MZ, ht, len, mincol, maxcol ) \
  77.                  MDzAutoDensityMap( MZ[0], ht, len, mincol, maxcol )
  78. #define MD_zDataDensityMap( MZ, ht, len ) \
  79.                  MDzDataDensityMap( MZ[0], ht, len )
  80.  
  81. void __vf MDxyzAutoDensityMap( dVector X, dVector Y, dPMatrix MZ,
  82.                              unsigned ht, unsigned len,
  83.                              COLORREF mincolor, COLORREF maxcolor );
  84. void __vf MDxyzDataDensityMap( dVector X, dVector Y, dPMatrix MZ,
  85.                              unsigned ht, unsigned len );
  86. void __vf MDzAutoDensityMap( dPMatrix MZ, unsigned ht, unsigned len,
  87.                              COLORREF mincolor, COLORREF maxcolor );
  88. void __vf MDzDataDensityMap( dPMatrix MZ, unsigned ht, unsigned len );
  89.  
  90. #define ME_xyzAutoDensityMap( X, Y, MZ, ht, len, mincol, maxcol ) \
  91.                  MExyzAutoDensityMap( X, Y, MZ[0], ht, len, mincol, maxcol )
  92. #define ME_xyzDataDensityMap( X, Y, MZ, ht, len ) \
  93.                  MExyzDataDensityMap( X, Y, MZ[0], ht, len )
  94. #define ME_zAutoDensityMap( MZ, ht, len, mincol, maxcol ) \
  95.                  MEzAutoDensityMap( MZ[0], ht, len, mincol, maxcol )
  96. #define ME_zDataDensityMap( MZ, ht, len ) \
  97.                  MEzDataDensityMap( MZ[0], ht, len )
  98.  
  99. void __vf MExyzAutoDensityMap( eVector X, eVector Y, ePMatrix MZ,
  100.                                unsigned ht, unsigned len,
  101.                                COLORREF mincolor, COLORREF maxcolor );
  102. void __vf MExyzDataDensityMap( eVector X, eVector Y, ePMatrix MZ,
  103.                                unsigned ht, unsigned len );
  104. void __vf MEzAutoDensityMap( ePMatrix MZ, unsigned ht, unsigned len,
  105.                              COLORREF mincolor, COLORREF maxcolor );
  106. void __vf MEzDataDensityMap( ePMatrix MZ, unsigned ht, unsigned len );
  107.  
  108.  
  109. /*  Color-Map: each range of values is associated with a certain color.
  110.     Values are defined in a vector ValScale, associated colors in ColScale.
  111.     The parameter "mode" decides how to interpret ValScale:
  112.     mode=0: Val is mid-point;      +1: Val gives upper limit;
  113.         -1: Val gives lower limit.
  114. */
  115. /* not yet implemented:
  116. void __vf M_findColorMapBounds( extended xmin, extended xmax,
  117.                                 extended ymin, extended ymax,
  118.                                 extended zmin, extended zmax );
  119. void __vf M_setColorMapBounds(  extended xmin, extended xmax,
  120.                                 extended ymin, extended ymax,
  121.                                 extended zmin, extended zmax );
  122.  
  123. void __vf MFxyzAutoColorMap( fVector X, fVector Y, fPMatrix MZ,
  124.                              unsigned ht, unsigned len,
  125.                              fVector ValScale, COLORREF _VFAR *ColScale,
  126.                              unsigned ncolors, int mode );
  127. void __vf MFxyzDataColorMap( fVector X, fVector Y, fPMatrix MZ,
  128.                              unsigned ht, unsigned len );
  129. void __vf MFzAutoColorMap(   fPMatrix MZ, unsigned ht, unsigned len,
  130.                              fVector ValScale, COLORREF _VFAR *ColScale,
  131.                              unsigned ncolors, int mode );
  132. void __vf MFzDataColorMap(   fPMatrix MZ, unsigned ht, unsigned len );
  133.  
  134. void __vf MDxyzAutoColorMap( dVector X, dVector Y, dPMatrix MZ,
  135.                              unsigned ht, unsigned len,
  136.                              dVector ValScale, COLORREF _VFAR *ColScale,
  137.                              unsigned ncolors, int mode );
  138. void __vf MDxyzDataColorMap( dVector X, dVector Y, dPMatrix MZ,
  139.                              unsigned ht, unsigned len );
  140. void __vf MDzAutoColorMap(   dPMatrix MZ, unsigned ht, unsigned len,
  141.                              dVector ValScale, COLORREF _VFAR *ColScale,
  142.                              unsigned ncolors, int mode );
  143. void __vf MDzDataColorMap(   dPMatrix MZ, unsigned ht, unsigned len );
  144.  
  145. void __vf MExyzAutoColorMap( eVector X, eVector Y, ePMatrix MZ,
  146.                              unsigned ht, unsigned len,
  147.                              eVector ValScale, COLORREF _VFAR *ColScale,
  148.                              unsigned ncolors, int mode );
  149. void __vf MExyzDataColorMap( eVector X, eVector Y, ePMatrix MZ,
  150.                              unsigned ht, unsigned len );
  151. void __vf MEzAutoColorMap(   ePMatrix MZ, unsigned ht, unsigned len,
  152.                              eVector ValScale, COLORREF _VFAR *ColScale,
  153.                              unsigned ncolors, int mode );
  154. void __vf MEzDataColorMap(   ePMatrix MZ, unsigned ht, unsigned len );
  155. */
  156.  
  157. #ifdef __cplusplus
  158. }
  159. #endif
  160. #endif /* __MGRAPH_H */
  161.